package student;

public class Student {
    /*设计一个javaBean
        1.学生类(Student)
        2.属性包含(name,age,gender,id)
        3.属性私有化(封装每一个属性的get()&set()方法)
        4.方法自定义
        5.Student 的空参构造函数和带全部参数的构造函数
        6.打印实例化对象键值对形式的toString()方法*/
   private String name;
   private int age;
   private String gender;
   private int id;

   //alt+insert


    public Student() {
    }

    public Student(String name, int age, String gender, int id) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", id=" + id +
                '}';
    }
    //自定义的方法
    public void study(){
        System.out.println("study java");
    }
}
